/*
 * @Author: 李楚胜 lics@epsoft.com.cn
 * @Date: 2025-02-08 16:37:23
 * @LastEditors: 李楚胜 lics@epsoft.com.cn
 * @LastEditTime: 2025-02-13 11:23:25
 * @FilePath: \A0001\vite.config.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// 引入
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
  plugins: [
    vue(),
    //增加下面这段代码，自动导入vue核心的包
    AutoImport({
      include: [
        /\.[tj]sx?$/,
        /\.vue$/,
        /\.vue\?vue/,
        /\.md$/,
      ],
      imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
      //注意这个配置和src同级
      dts: './auto-imports.d.ts'
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true,
        },
      },
    },
  },
})
